﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UtilZ.Dotnet.Ex.Communication.Net.MQBase
{
    /// <summary>
    /// MQ消息队列接口
    /// </summary>
    public interface IMQMessageQueue : IDisposable
    {
        /// <summary>
        /// 获取BrokerInfo
        /// </summary>
        MQBrokerInfo BrokerInfo { get; }

        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="topic">主题</param>
        /// <param name="message">消息</param>
        /// <param name="strategy">发布策略</param>
        void Push(string topic, IMQMessage message, IMessagePublishStrategy strategy);

        /// <summary>
        /// 订阅
        /// </summary>
        /// <param name="subscribInfo">订阅对象</param>
        void Subscribe(IMQSubscribInfo subscribInfo);

        /// <summary>
        /// 取消订阅
        /// </summary>
        /// <param name="subscribInfo">订阅对象</param>
        void UnSubscribe(IMQSubscribInfo subscribInfo);

        /// <summary>
        /// 清空订阅
        /// </summary>
        void Clear();
    }
}
